<style>
    .flex {
        display: flex;
    }
    .col-sm-1 {
        height: 33px;
        line-height: 33px;
    }
    .update{
        padding-left: 20px;
    }
    .span-input{
        display: none;
    }
    .sendajax{
        display: none;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">店铺名称:</label>
        <div class="col-xs-12 col-sm-4">
            <span class="spantext">【ID：{$row.shop.id|htmlentities}】{$row.shop.shop_name|htmlentities}</span>
            <span class="span-input col-xs-12 col-sm-6"><input type="text" class="form-control" name="shopid" value="{$row.shop.id|htmlentities}" data-id="{$row.id}" data-shopno="{$row.shop.shop_no}" data-shopid="{$row.shop.id}"></span>
            <a class="update" href="javascript:;">修改id</a>
            <a class="sendajax" href="javascript:;">提交</a>
        </div>
        <label class="col-xs-12 col-sm-2">店铺平台:</label>
        <div class="col-xs-12 col-sm-4">
            {$row.shop.shop_type_text|htmlentities}
            {notempty name="$row.shop.business_license_pic"}
                <a class="update" target="_blank" href="{$row.shop.business_license_pic}">【查看店铺二维码】</a>
            {/notempty}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">渠道名称:</label>
        <div class="col-xs-12 col-sm-4" id="play_order_no">
            {$row.is_yunzhan}
        </div>
        <label class="col-xs-12 col-sm-2">平台单号:</label>
        <div class="col-xs-12 col-sm-4" id="play_order_no">
            {if $row.play_order_no!=0}{$row.play_order_no|htmlentities}{else /}{$row.yunzhan_order_no|htmlentities}{/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">活动方案:</label>
        <div class="col-xs-12 col-sm-4">
            {$row.scheme_no}
        </div>
        <label class="col-xs-12 col-sm-2">外卖单号:</label>
        <div class="col-xs-12 col-sm-4">
            <span class="spantext">{$row.proof.wm_order_sn|htmlentities}</span>
            <span class="span-input col-xs-12 col-sm-10"><input class="form-control" type="text" name="proofwm_order_sn" value="{$row.proof.wm_order_sn|htmlentities}" data-id="{$row.id}" data-shopno="{$row.shop.shop_no}" data-shopid="{$row.shop.id}"></span>
            {notempty name="$row.proof.wm_order_sn"}
                <a class="update" href="javascript:;">修改</a>
                <a class="sendajax" href="javascript:;">提交</a>
            {/notempty}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">平台服务费:</label>
        <div class="col-xs-12 col-sm-4">
            {if $row.order_status==-9 or $row.order_status==-8 or $row.order_status==-7}
                {$row.service_charge_amt-$row.proof.financial_review_num+$row.proof.deduction_beans|floatval}
            {elseif $row.order_status==-4 /}
                0
            {else /}
                {$row.service_charge_amt|htmlentities}
            {/if}
        </div>
        <label class="col-xs-12 col-sm-2">活动发布人:</label>
        <div class="col-xs-12 col-sm-4">
            {$row.shop.salesman_admin_id|htmlentities}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">商家结算金额:</label>
        <div class="col-xs-12 col-sm-4">
            {if $row.order_status==-9 or $row.order_status==-8 or $row.order_status==-7}
                {$row.rebate_amt-$row.proof.financial_review_num|floatval}
            {elseif $row.order_status==-4 /}
                0
            {else /}
                {$row.rebate_amt|htmlentities}
            {/if}
        </div>
        <label class="col-xs-12 col-sm-2">渠道结算金额:</label>
        <div class="col-xs-12 col-sm-4">
            {if $row.order_status==-9 or $row.order_status==-8 or $row.order_status==-7}
                {$row.rebate_amt-$row.service_charge_amt-$row.proof.deduction_beans|floatval}
            {elseif $row.order_status==-4 /}
                0
            {else /}
                {$row.actual_rebate_amt}
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">减少商家订单金额:</label>
        <div class="col-xs-12 col-sm-4" id="jsqdjsje">
            {$row.proof.financial_review_num|floatval}
        </div>
        <label class="col-xs-12 col-sm-2">减少渠道结算金额:</label>
        <div class="col-xs-12 col-sm-4" id="jsqdjsje">
            {$row.proof.deduction_beans|floatval}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">订单状态:</label>
        <div class="col-xs-12 col-sm-4">
            {$order_status_text|htmlentities}
        </div>
        <label class="col-xs-12 col-sm-2">抢单时间:</label>
        <div class="col-xs-12 col-sm-4">
            {$row.place_time_text|htmlentities}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">重复订单:</label>
        <div class="col-xs-12 col-sm-4">
            {if $is_effect>1}{if $row.is_effect==1}已生效{else /}已失效{/if}{/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-2">订单截图:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview" id="p-images">
                <li class="col-xs-3"><a href="{$row.proof.one_image_url}" data-url="{$row.proof.one_image_url}" target="_blank" class="thumbnail"><img src="{$row.proof.one_image_url}" class="img-responsive"></a></li>
                <li class="col-xs-3"><a href="{$row.proof.two_image_url}" data-url="{$row.proof.two_image_url}" target="_blank" class="thumbnail"><img src="{$row.proof.two_image_url}" class="img-responsive"></a></li>
                <li class="col-xs-3"><a href="{$row.proof.three_image_url}" data-url="{$row.proof.three_image_url}" target="_blank" class="thumbnail"><img src="{$row.proof.three_image_url}" class="img-responsive"></a></li>
            </ul>
        </div>
    </div>
    {notempty name="row.proof.supplement"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">补充订单截图:</label>
            <div class="col-xs-12 col-sm-8">
                <ul class="row list-inline faupload-preview" id="p-images">
                    <li class="col-xs-3"><a href="{$row.proof.supplement.one_image}" data-url="{$row.proof.supplement.one_image}" target="_blank" class="thumbnail"><img src="{$row.proof.supplement.one_image}" class="img-responsive"></a></li>
                    <li class="col-xs-3"><a href="{$row.proof.supplement.two_image}" data-url="{$row.proof.supplement.two_image}" target="_blank" class="thumbnail"><img src="{$row.proof.supplement.two_image}" class="img-responsive"></a></li>
                    <li class="col-xs-3"><a href="{$row.proof.supplement.three_image}" data-url="{$row.proof.supplement.three_image}" target="_blank" class="thumbnail"><img src="{$row.proof.supplement.three_image}" class="img-responsive"></a></li>
                </ul>
            </div>
        </div>
    {/notempty}
    {if $row.is_fushen}
    {else /}
        {notempty name="row.proof.handle_admin_desc"}
        <div style="border: 1px dashed #a19e9e;border-radius: 5px;margin-bottom: 20px;">
            <div class="form-group">
                <label class="col-xs-12 col-sm-12" style="color: red;">审核客服处理</label>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2">操作时间:</label>
                <div class="col-xs-12 col-sm-4">
                    {$adminhandel.handle_time}
                </div>
                <label class="col-xs-12 col-sm-2">操作用户:</label>
                <div class="col-xs-12 col-sm-4">
                    {$adminhandel.optioner}
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2">操作方式:</label>
                <div class="col-xs-12 col-sm-4">
                    {$adminhandel.option}
                </div>
                <label class="col-xs-12 col-sm-2">备注:</label>
                <div class="col-xs-12 col-sm-4">
                    {$adminhandel.remark}
                </div>
            </div>
        </div>  
        {/notempty}
    {/if}
    {notempty name="aftersale"}
    {foreach $aftersale as $as}
        <div style="border: 1px dashed #a19e9e;border-radius: 5px;margin-bottom: 20px;">
        <div class="form-group">
            <label class="col-xs-12 col-sm-12" style="color: red;">{if $as.type=='客服审核拟取消或扣吃豆通过'}售后客服已处理{else /}{$as.type}{/if}</label>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">操作时间:</label>
            <div class="col-xs-12 col-sm-4">
                {$as.create_dt}
            </div>
            <label class="col-xs-12 col-sm-2">操作用户:</label>
            <div class="col-xs-12 col-sm-4">
                {$as.submit_user}
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">操作详情:</label>
            <div class="col-xs-12 col-sm-4">
                {switch name="as.type" }
                    {case value="确认通过审核"}
                        受理意见:{$as.content.sj.desc}</br>
                        退款金额:{$as.content.sj.amount}</br>
                        商家备注:{$as.content.sj.remark}</br>
                        扣款金额:{$as.content.yh.amount}</br>
                        用户备注:{$as.content.yh.remark}</br>
                    {/case}
                    {case value="业务员提交异常"}
                        异常类型:{$as.content.desc}</br>
                        备注:{$as.content.remark}</br>
                    {/case}
                    {case value="三方提交异常"}
                        异常类型:{$as.content.desc}</br>
                        备注:{$as.content.remark}</br>
                    {/case}
                    {case value="财务已处理"}
                        减少商家订单金额:
                        <span id="financial_review_num1" data-id="{$row.id}">   {$row.proof.financial_review_num|htmlentities}
                        </span> 
                        <span id="financial_review_num2" style="display: none;">
                            <input type="number" name="financial_review_num" value="{$row.proof.financial_review_num|htmlentities}">
                            <a class="financial_review_numsendajax" href="javascript:;">提交</a>
                        </span>
                        {in name="auth_groups" value="1,10"}<a href="javascript:;" id="financial_review_numevent">修改</a>{/in}</br>
                        减少渠道结算金额:
                        <span id="deduction_beans1" data-id="{$row.id}">
                            {$row.proof.deduction_beans|htmlentities}
                        </span> 
                        <span id="deduction_beans2" style="display: none;">
                            <input type="number" name="deduction_beans" value="{$row.proof.deduction_beans|htmlentities}">
                            <a class="deduction_beanssendajax" href="javascript:;">提交</a>
                        </span>
                        {in name="auth_groups" value="1,10"}<a href="javascript:;" id="deduction_beansevent">修改</a>{/in}
                        </br>


                        受理意见:{if $row.proof.financial_review==1}取消该订单{elseif condition="$row.proof.financial_review eq 2"}减少订单金额{elseif condition="$row.proof.financial_review eq 3"}需用户提交凭证{/if}</br>
                    {/case}
                    {case value="客服审核拟扣吃豆通过"}
                        受理意见:{$as.content.sj.desc}</br>
                        退款金额:{$as.content.sj.amount}</br>
                        商家备注:{$as.content.sj.remark}</br>
                        扣款金额:{$as.content.yh.amount}</br>
                        用户备注:{$as.content.yh.remark}</br>
                    {/case}
                    {case value="客服审核拟取消或扣吃豆通过"}
                        受理意见:{$as.content.sj.desc}</br>
                        退款金额:{$as.content.sj.amount}</br>
                        商家备注:{$as.content.sj.remark}</br>
                        扣款金额:{$as.content.yh.amount}</br>
                        用户备注:{$as.content.yh.remark}</br>
                    {/case}
                    {case value="商家提交异常"}
                        异常类型:{$as.content.desc}</br>
                        备注:{$as.content.remark}</br>
                    {/case}
                    {case value="修改商家结算金额"}
                        修改后金额:{$as.content.value}</br>
                    {/case}
                    {case value="修改渠道结算金额"}
                        修改后金额:{$as.content.value}</br>
                    {/case}
                {/switch}
            </div>
            {if $as.type=='客服审核拟取消或扣吃豆通过'}
            <div class="col-xs-12 col-sm-4">
                <input type="button" name="copy" value="复制异常订单" class="btn btn-danger" id="copy">
            </div>
            {/if}
        </div>
        {notempty name="as.content.img"}
            <div class="form-group"> 
                <label class="col-xs-12 col-sm-2">异常截图:</label>
                <div class="col-xs-12 col-sm-8">
                    <ul class="row list-inline faupload-preview" id="p-images">
                        {foreach $as.content.img as $aci}
                        <li class="col-xs-3"><a href="{$aci}" data-url="{$aci}" target="_blank" class="thumbnail"><img src="{$aci}" class="img-responsive"></a></li>
                        {/foreach}
                    </ul>
                </div>
            </div>
        {/notempty}
        {present name="as.content.yh.file"}
            <div class="form-group"> 
                <label class="col-xs-12 col-sm-2">用户凭证:</label>
                <div class="col-xs-12 col-sm-8">
                    <ul class="row list-inline faupload-preview" id="p-images">
                        <li class="col-xs-3"><a href="{$as.content.yh.file}" data-url="{$as.content.yh.file}" target="_blank" class="thumbnail"><img src="{$as.content.yh.file}" class="img-responsive"></a></li>
                    </ul>
                </div>
            </div>
        {/present}
        </div>
    {/foreach}
    {/notempty}
    <!--业务员帮商家提交异常反馈-->
    {if $row.proof.handle_status==1}
    {in name="auth_groups" value="1,3,6"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">异常类型:</label>
            <div class="col-xs-12 col-sm-8">
                <select  id="c-desc" class="form-control selectpicker" name="row[desc]">
                    {foreach name="abnormal_group" item="vo"}
                        <option value="{$vo}" {in name="vo" value="$vo"}selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">异常凭证:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-img" class="form-control" size="50" name="row[img]" type="text" value="">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-img" class="btn btn-danger faupload" data-input-id="c-img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-img" class="btn btn-primary fachoose" data-input-id="c-img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-img"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-img"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">备注:</label>
            <div class="col-xs-12 col-sm-8">
                <input type="text" id="c-remark" class="form-control" name="row[remark]">
            </div>
        </div>
    {/in}
    {/if}
    <!--审核客服审核待审核的订单-->
    {if $row.proof.handle_status==0 and ($row.order_status==2 or $row.order_status==-5)}
    {in name="auth_groups" value="1,7"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">扣款金额:</label>
            <div class="col-xs-12 col-sm-7">
                <input type="number" step="0.01" id="c-amount" class="form-control" name="row[amount]">
            </div>
            <div class="col-xs-12 col-sm-1">
                元
            </div>
        </div>   
    {/in}
    {/if}
    
    {if $row.proof.handle_status==0 and $row.order_status==2}
    {in name="auth_groups" value="1,7"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">备注:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea type="text" id="c-remark" class="form-control" name="row[remark]" cols="30" rows="5"></textarea>
            </div>
        </div> 
    {/in}
    {/if}
    <!--审核客服审核不满意提交的订单-->
    {if $row.proof.handle_status==0 and $row.order_status==-5}
    {in name="auth_groups" value="1,7"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">备注:</label>
            <div class="col-xs-12 col-sm-8">
                <input type="text" id="c-remark" class="form-control" name="row[remark]">
            </div>
        </div>  
    {/in}
    {/if}
    <!--售后客服审核异常订单-->
    {if $row.proof.handle_status==0 and $row.order_status==-7}
    {in name="auth_groups" value="1,8"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-6">商家受理:</label>
            <label class="col-xs-12 col-sm-6">用户受理:</label>
        </div> 
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">受理意见:</label>
            <div class="col-xs-12 col-sm-4">
                <select  id="c-desc" class="form-control selectpicker" name="row[sj][desc]">
                    <option value="请选择" >请选择</option>
                    {foreach name="slyj" item="s" key="k"}
                    <option value="{$k}" >{$s}</option>
                    {/foreach}
                </select>
            </div>
            <label class="col-xs-12 col-sm-2">用户凭证:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="input-group">
                    <input id="c-file" class="form-control" size="50" name="row[yh][file]" type="text" value="">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-file"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-file"></ul>
            </div>
        </div>  
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">退款金额:</label>
            <div class="col-xs-12 col-sm-3">
                <input type="number" step="0.01" id="c-sjamount" class="form-control" name="row[sj][amount]">
            </div>
            <div class="col-xs-12 col-sm-1">
                元
            </div>
            <label class="col-xs-12 col-sm-2">扣款金额:</label>
            <div class="col-xs-12 col-sm-3">
                <input type="number" step="0.01" id="c-yhamount" class="form-control" name="row[yh][amount]">
            </div>
            <div class="col-xs-12 col-sm-1">
                元
            </div>
        </div> 
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">备注:</label>
            <div class="col-xs-12 col-sm-4">
                <textarea name="row[sj][remark]" class="form-control" id="c-sjremark" cols="30" rows="5"></textarea>
            </div>
            <label class="col-xs-12 col-sm-2">备注:</label>
            <div class="col-xs-12 col-sm-4">
                <textarea name="row[yh][remark]" class="form-control" id="c-yhremark" cols="30" rows="5"></textarea>
            </div>
        </div>  
    {/in}
    {/if}
    <!--财务部审核-->
    {if $row.proof.handle_status==2 and $row.order_status==-8}
    {in name="auth_groups" value="1,10"}
        <div class="form-group">
            <label class="col-xs-12 col-sm-6">商家处理:</label>
            <label class="col-xs-12 col-sm-6">用户受理:</label>
        </div> 
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">减少商家订单金额:</label>
            <div class="col-xs-12 col-sm-4">
                {$row.proof.financial_review_num|htmlentities}元
            </div>
            <label class="col-xs-12 col-sm-3">减少渠道结算金额:</label>
            <div class="col-xs-12 col-sm-3">
                {$row.proof.deduction_beans|htmlentities}元
            </div>
        </div> 
        <div class="form-group">
            <label class="col-xs-12 col-sm-2">受理意见:</label>
            <div class="col-xs-12 col-sm-4">
                <select  id="c-desc" class="form-control selectpicker" name="row[sj][desc]" disabled="disabled">
                    <option value="请选择" >请选择</option>
                    <option value="1" {if $row.proof.financial_review==1}selected{/if}>取消该订单</option>
                    <option value="2" {if $row.proof.financial_review==2}selected{/if} >减少订单金额</option>
                    <option value="3" {if $row.proof.financial_review==3}selected{/if} >需用户提交凭证</option>
                </select>
            </div>
        </div>  
    {/in}
    {/if}
    <input type="hidden" id="type" name="row[type]" value="">
    <div class="form-group layer-footer">
        <label class="col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
        <!--业务员提交异常-->
        {if $row.proof.handle_status==1}
            {in name="auth_groups" value="1,3,6"}
            <button type="submit" id="submit1" class="btn btn-primary btn-embossed disabled">提交异常</button>
            {/in}
        {/if}
        <!--审核客服审核待审核订单-->
        {if $row.proof.handle_status==0 and $row.order_status==2}
            {in name="auth_groups" value="1,7"}
            {if $is_fushen===false}
                <button type="submit" id="submit2" class="btn btn-success btn-embossed disabled">审核通过</button>
            {/if}
            {if $row.play.is_pay==0}
                <button type="submit" id="submit8" class="btn btn-warning btn-embossed disabled">提交商家复审</button>
            {/if}
            <button type="submit" id="submit3" class="btn btn-danger btn-embossed disabled">驳回审核</button>
            <button type="submit" id="submit7" class="btn btn-primary btn-embossed disabled">取消订单</button>
            <button type="submit" id="submit6" class="btn btn-primary btn-embossed disabled">不满意通过</button>
            {/in}
        {/if}
        <!--审核客服审核待审核订单-->
        {if $row.order_status==-3}
            {in name="auth_groups" value="1,7"}
            <button type="submit" id="submit7" class="btn btn-primary btn-embossed disabled">取消订单</button>
            {/in}
        {/if}
        <!--审核客服提交商家异常的处理结果-->
        <!-- {if $row.proof.handle_status==1}
            {in name="auth_groups" value="1,7"}
            <button type="submit" id="submit4" class="btn btn-primary btn-embossed disabled">提交财务</button>
            {/in}
        {/if} -->
        <!--财务处理-->
        {if $row.proof.handle_status==2 and $row.order_status==-8}
            {in name="auth_groups" value="1,10"}
            <button type="submit" id="submit5" class="btn btn-primary btn-embossed disabled">财务已处理</button>
            {/in}
        {/if}
        <!--不满意通过-->
        {if $row.proof.handle_status==0 and $row.order_status==-5}
            {in name="auth_groups" value="1,7"}
            <button type="submit" id="submit3" class="btn btn-danger btn-embossed disabled">驳回审核</button>
            <button type="submit" id="submit6" class="btn btn-primary btn-embossed disabled">不满意通过</button>
            {/in}
        {/if}
        <!--售后客服提交用户凭证-->
        {if $row.proof.handle_status==0 and $row.order_status==-7}
            {in name="auth_groups" value="1,8"}
            <button type="submit" id="submit2" class="btn btn-success btn-embossed disabled">审核通过</button>
            <button type="submit" id="submit4" class="btn btn-primary btn-embossed disabled">提交财务</button>
            {/in}
        {/if}
        <!--商家复审后合格-->
        {if $row.order_status==6}
            {in name="auth_groups" value="1,7"}
            <button type="submit" id="submit9" class="btn btn-success btn-embossed disabled">商家复审合格</button>
            {/in}
        {/if}
        </div>
    </div>
</form>


<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script>
    window.onload = function(){
        var type = document.getElementById("type");
        var submit1 = document.getElementById("submit1");
        var submit2 = document.getElementById("submit2");
        var submit3 = document.getElementById("submit3");
        var submit4 = document.getElementById("submit4");
        var submit5 = document.getElementById("submit5");
        var submit6 = document.getElementById("submit6");
        var submit7 = document.getElementById("submit7");
        var submit8 = document.getElementById("submit8");
        var submit9 = document.getElementById("submit9");
        var form = document.getElementById("edit-form");
        if (submit1!=undefined) {
            submit1.onclick = function(){
                type.value=submit1.innerHTML
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit2!=undefined) {
            submit2.onclick = function(){
                type.value=submit2.innerHTML
                // var actual_pay = $('#c-actual_pay')
                // if (actual_pay.length>0 && actual_pay.val()=='') {
                //     alert('请填写用户实付金额')
                //     return false
                // }
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit3!=undefined) {
            submit3.onclick = function(){
                type.value=submit3.innerHTML
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit4!=undefined) {
            submit4.onclick = function(){
                type.value=submit4.innerHTML
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit5!=undefined) {
            submit5.onclick = function(){
                type.value=submit5.innerHTML
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit6!=undefined) {
            submit6.onclick = function(){
                type.value=submit6.innerHTML
                if (confirm('确认不满意通过订单？')==true){ 
                    form.submit();Layer.closeAll('dialog');
                }else{ 
                    Layer.closeAll('dialog'); 
                } 
            }
        }
        if (submit7!=undefined) {
            submit7.onclick = function(){
                type.value=submit7.innerHTML
                if (confirm('确认取消订单？')==true){ 
                    form.submit();Layer.closeAll('dialog');
                }else{ 
                    Layer.closeAll('dialog'); 
                } 
            }
        }
        if (submit8!=undefined) {
            submit8.onclick = function(){
                type.value=submit8.innerHTML
                // var actual_pay = $('#c-actual_pay')
                // if (actual_pay.length>0 && actual_pay.val()=='') {
                //     alert('请填写用户实付金额')
                //     return false
                // }
                form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit9!=undefined) {
            submit9.onclick = function(){
                type.value=submit9.innerHTML
                form.submit();Layer.closeAll('dialog');
            }
        }
    }
    $('.update').on('click',function (e) {
        $(this).siblings('.spantext').hide();
        $(this).siblings('.span-input').show();
        $(this).addClass('sendajax')
        $(this).hide();
        $(this).siblings('.sendajax').show();
    })
    $('.sendajax').on('click',function (e) {
        var spantext = $(this).siblings('.spantext')
        $(this).siblings('.spantext').show();
        $(this).siblings('.span-input').hide();
        $(this).hide();
        $(this).siblings('.update').show();
        var paramkey = $(this).siblings('.span-input').find('input').attr('name')
        var orderid=$(this).siblings('.span-input').find('input').attr('data-id')
        var shopno = $(this).siblings('.span-input').find('input').attr('data-shopno')
        var shopid = $(this).siblings('.span-input').find('input').attr('data-shopid')
        var values = $(this).siblings('.span-input').find('input').val()
        var data = {name:paramkey,value:values,shopno:shopno,orderid:orderid}
        $.ajax({
            url:"/hFtNsJROTk.php/order/order/updateparam",
            data: data,
            success:function(result){
                if (result.code==1) {
                    if (paramkey=='shopid') {
                        values = '【ID:'+values+'】'+result.data
                    }
                    spantext.text(values)
                } else {
                    alert(result.msg)
                }
            }
        })
    })
    $('#financial_review_numevent').on('click',function (e) {
        $('#financial_review_numevent').hide();
        $('#financial_review_num1').hide();
        $('#financial_review_num2').show();
    })
    $('#deduction_beansevent').on('click',function (e) {
        $('#deduction_beansevent').hide();
        $('#deduction_beans1').hide();
        $('#deduction_beans2').show();
    })
    $('.financial_review_numsendajax').on('click',function (e) {
        var orderid=$('#financial_review_num1').attr('data-id')
        var values = $('#financial_review_num2').find('input').val()
        var data = {value:values,orderid:orderid}
        $.ajax({
            url:"/hFtNsJROTk.php/order/order/financial_review_numevent",
            data: data,
            success:function(result){
                if (result.code==1) {
                    var values = $('#financial_review_num2').find('input').val()
                    $('#financial_review_num1').text(values)
                    $('#financial_review_num1').show();
                    $('#financial_review_numevent').show();
                    $('#financial_review_num2').hide();
                } else {
                    alert(result.msg)
                }
            }
        })
    })
    $('.deduction_beanssendajax').on('click',function (e) {
        var orderid=$('#deduction_beans1').attr('data-id')
        var values = $('#deduction_beans2').find('input').val()
        var data = {value:values,orderid:orderid}
        $.ajax({
            url:"/hFtNsJROTk.php/order/order/deduction_beansevent",
            data: data,
            success:function(result){
                if (result.code==1) {
                    var values = $('#deduction_beans2').find('input').val()
                    $('#deduction_beans1').text(values)
                    $('#deduction_beans1').show();
                    $('#deduction_beansevent').show();
                    $('#deduction_beans2').hide();
                } else {
                    alert(result.msg)
                }
            }
        })
    })
    $('#copy').click(function () {
        var wm_order_sn = "<?php echo $row['wm_order_sn']; ?>";
        var aftersale = '<?php echo json_encode($aftersale,JSON_UNESCAPED_UNICODE); ?>';
        aftersale = JSON.parse(aftersale)
        console.log(aftersale)
        var desc = '';
        for (var i = aftersale.length - 1; i >= 0; i--) {
            if (aftersale[i].type=='业务员提交异常') {
                desc = aftersale[i].content.remark
            }
        }
        var text = wm_order_sn+'  '+desc;
        str=$('#jsqdjsje').text().replace(/\s+/g, '');
        // text = text+'  扣'+str;
        console.log(text)
        copyToClipboard_js(text)
    })
    function copyToClipboard_js(txt) {
        var temp = document.createElement("textarea"); //声明创建一个input元素
        document.body.appendChild(temp); //在body中追加input元素
        temp.value = txt; //把要复制的文字赋予input元素
        temp.select(); //选择要复制的文字
        document.execCommand("copy"); //把文字复制到剪贴板
        document.body.removeChild(temp); //移除body追加的input元素
    }
</script>
